import 'package:cbec_app/utils/logger.dart';

class AddressListEntity {
  String? id;
  String? uid;
  String? receiveName;
  String? receiveAddress;
  String? receivePhone;
  int? province;
  String? provinceName;
  int? city;
  String? cityName;
  int? district;
  String? districtName;
  int? isDefault;

  AddressListEntity(
      {this.id,
      this.uid,
      this.receiveName,
      this.receiveAddress,
      this.receivePhone,
      this.province,
      this.provinceName,
      this.city,
      this.cityName,
      this.district,
      this.districtName='',
      this.isDefault});

  AddressListEntity.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    uid = json['uid'];
    receiveName = json['receiveName'];
    receiveAddress = json['receiveAddress'];
    receivePhone = json['receivePhone'];
    province = json['province'];
    provinceName = json['provinceName'];
    city = json['city'];
    cityName = json['cityName'];
    district = json['district'];
    districtName = json['districtName']??'';
    isDefault = json['isDefault'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['id'] = id;
    data['uid'] = uid;
    data['receiveName'] = receiveName;
    data['receiveAddress'] = receiveAddress;
    data['receivePhone'] = receivePhone;
    data['province'] = province;
    data['provinceName'] = provinceName;
    data['city'] = city;
    data['cityName'] = cityName;
    data['district'] = district;
    data['districtName'] = districtName??'';
    data['isDefault'] = isDefault;
    return data;
  }
}